package model;

import interfaces.KurvItemInterface;
import interfaces.OrdreInterface;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;

public class Ordre extends UnicastRemoteObject implements OrdreInterface {
    private int ordreID;
    private String fNavn;
    private boolean betalt;
    private boolean modtaget;
    private int sum;    
    private ArrayList<KurvItemInterface> vareListe;

    public Ordre(int ordreID, String fNavn) throws RemoteException {
        this.ordreID = ordreID;
        this.fNavn = fNavn;
        betalt = false;
        modtaget = false;
        sum = 0;
        vareListe = new ArrayList<>();
    }

    /**
     * tilføjer en vare fra kurvItem til ordren
     *
     * @param item
     */
    @Override
    public void addItem(KurvItemInterface item) throws RemoteException {
        vareListe.add(item);
    }

    /**
     *
     * @return
     */
    @Override
    public ArrayList<KurvItemInterface> getVareListe() throws RemoteException {
        return vareListe;
    }

    @Override
    public int getOrdreID() throws RemoteException {
        return ordreID;
    }

    @Override
    public String getfNavn() throws RemoteException {
        return fNavn;
    }

    @Override
    public boolean isBetalt() throws RemoteException {
        return betalt;
    }

    @Override
    public void setBetalt(boolean betalt) throws RemoteException {
        this.betalt = betalt;
    }

    @Override
    public boolean isModtaget() throws RemoteException {
        return modtaget;
    }

    @Override
    public int getSum() throws RemoteException {
        return sum;
    }

    @Override
    public void setModtaget(boolean modtaget) throws RemoteException {
        this.modtaget = modtaget;
    }

    @Override
    public void setSum(int sum) throws RemoteException {
        this.sum = sum;
    }

    

}
